/*****************************************************************
 Naicigam Engine v0.1

 File: VertexBuffer.inl
 Created: 01/03/08
*****************************************************************/



template<class VertexFormat, unsigned int FVF>
unsigned int VertexBuffer<VertexFormat,FVF>::currentId = 0;

//----------------------------------------------------------------
template<class VertexFormat, unsigned int FVF>
VertexBuffer<VertexFormat,FVF>::VertexBuffer (unsigned int _count)
:
vertices(_count),
id(currentId)
{
	currentId++;
}

template<class VertexFormat, unsigned int FVF>
unsigned int VertexBuffer<VertexFormat,FVF>::GetId() const
{
	return id;
}
template<class VertexFormat, unsigned int FVF>
void VertexBuffer<VertexFormat,FVF>::SetVertex(unsigned int _index, const VertexFormat& _v)
{
	vertices[_index] = _v;
}

template<class VertexFormat, unsigned int FVF>
const VertexFormat& VertexBuffer<VertexFormat,FVF>::GetVertex(unsigned int _index) const
{
	return vertices[_index];
}

template<class VertexFormat, unsigned int FVF>
size_t VertexBuffer<VertexFormat,FVF>::GetVertexCount() const
{
	return vertices.size();
}

template<class VertexFormat, unsigned int FVF>
const VertexFormat* VertexBuffer<VertexFormat,FVF>::GetVerticesPtr () const
{
	return &(vertices.front());
}

template<class VertexFormat, unsigned int FVF>
VertexFormat* VertexBuffer<VertexFormat,FVF>::GetVerticesPtr ()
{
	return &(vertices.front());
}